<template>
  <div class="index">
    <div class="header flex_sb flex_a">
      <img class="logo" src="@a/img/logo111.png" alt="" @click="toPage('home')">
      <div class="menu_bnt" :class='isMenu?"menu_bnt_z":""' @click="isMenu=!isMenu"></div>
    </div>
    <div class="mask" :class="isMenu?'mask_show':''" @click="isMenu=false">
      <div class="menu_list" :class="isMenu?'menu_list1':''" @click.stop="">
        <div class="menu_item" v-for="item in menuList" :key="item.id">
          <div class="menu_item1" :class="$route.name==item.url?'menu_item1_a':''" @click="item.children.length>0?item.isShow=!item.isShow:toPage(item.url)">{{item.name}} 
            <i v-if="item.children.length>0" class="el-icon-arrow-down jt" :class="item.isShow?'shang':''" /> 
          </div>
          <div :class="[item.isShow?'':'noShow',item.name=='产品'?'noShow1':'noShow2']" v-show="item.children.length>0">
            <div class="menu_item2" :class="[$route.name==item1.url?'menu_item1_a':'']" v-show="item.children.length>0" v-for="(item1,index) in item.children" :key="index" @click="toPage(item1.url)">
              {{item1?item1.name:''}}
            </div>
          </div>
          
        </div>
      </div>
    </div>
    <div class="i_content">
      <router-view/>
    </div>
    <div class="ttt_div">
      <div class="b_s">园域大数据，数字化赋能精准招商</div>
      <div class="s_s">让数据多跑路  让招商干部少走弯路</div>
      <div class="flex_sb bb_b">
        <div class="bb1" @click="toppt('experience')">查看详情</div>
        <div class="bb2" @click="toPage('experience')">平台咨询</div>
      </div>
    </div>
    <!-- <div class="footerWrap"></div> -->
    <div class="bottom">
      <div class="logo_b"></div>
      <div class="code"></div>
      <div class="text">长按识别二维码，关注园域公众号</div>
      <div class='btn'>联系电话：400-962-5108</div>
    </div>
    <div class="ddd_d" @click="toP">
      @园域 监制 沪ICP备19031966号-2
    </div>
  </div>
</template>
<script>
import { encode } from '@/utils/utils.js'
import { jssdk } from '@/api/api'
export default {
  data(){
    return{
      isHome:true,
      isMenu:false,
      menuList:[
        {id:'1',name:'首页',children:[],url:'home'},
        {id:'2',name:'产品',isShow:false,children:[{id:'6',name:'产业链大数据招商云',url:'project1'},{id:'7',name:'区域产业链投资与招商网',url:'project2'},{id:'8',name:'一码投APP招商',url:'project3'},]},
        {id:'3',name:'服务',isShow:false,children:[{id:'9',name:'产业链数字化赋能中心',url:'project4'},{id:'10',name:'招商目标尽调',url:'project5'},{id:'11',name:'招商培训',url:'project6'},{id:'12',name:'招商项目精包装',url:'project7'}]},
        {id:'4',name:'产业链库',children:[],url:'chainDiv'},
        {id:'5',name:'关于我们',children:[],url:'about'},
      ]
    }
  },
  created(){
    this.isHome=this.$route.name=='home'?true:false
    jssdk({uniacid:5,url: encode(window.location.href)}).then(res=>{
      this.wxInit(res.data)
    })
  },
  mounted(){
    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
    }else{
      window.location.href = 'http://www.parkic.com/#/'+this.$route.name
    }
    window.addEventListener("resize", 
      ()=>{
        console.log(this.$route.name)
        if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
        }else{
          window.location.href = 'http://www.parkic.com/#/'+this.$route.name
        }
      }
    );
  },
  watch:{
    '$route.name':function(val){
      this.isMenu = false
      jssdk({uniacid:5,url: encode(window.location.href)}).then(res=>{
        this.wxInit(res.data)
      })
      if(val!='home'){
        this.isHome=false
      }else{
        this.isHome=true
      }
      if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
      }else{
        window.location.href = 'http://www.parkic.com/#/'+this.$route.name
      }
    }
  },
  methods:{
     toppt(){
      window.open('http://view.officeapps.live.com/op/view.aspx?src='+'https://wqq103910.oss-cn-hangzhou.aliyuncs.com/files/3/2021/08/%E4%B8%80%E4%BA%91%E4%B8%80%E7%BD%91%E4%B8%80%E7%AB%AF%E4%B8%80%E4%B8%AD%E5%BF%83.pptx')
    },
     toP(){
      window.open('https://beian.miit.gov.cn/#/Integrated/index')
    },
    toChain(){
      window.open('http://bigdata.parkic.com/#/index?id=97')
    },
    toYY(){
      window.open('http://www.chinaichain.com')
    },
    toYY1(){
      window.open('http://www.chinaichain.com/chainDiv')
    },
    toPage(name){
      if(name == 'chainDiv'){
        window.open('http://www.chinaichain.com/chainDiv')
        return
      }
      this.$router.push( name )
    },
    wxInit(data){
      let that = this
      wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: data.appId, // 必填，公众号的唯一标识
        timestamp: data.timestamp, // 必填，生成签名的时间戳
        nonceStr: data.nonceStr, // 必填，生成签名的随机串
        signature: data.signature,// 必填，签名
        jsApiList: ['onMenuShareAppMessage','onMenuShareTimeline','updateAppMessageShareData','updateTimelineShareData'] // 必填，需要使用的JS接口列表
      })
      wx.ready(function () {   //需在用户可能点击分享按钮前就先调用
        wx.updateAppMessageShareData({ 
          title: document.title, // 分享标题
          desc: '园域大数据|整合800+产业链 30000个产业细分节点  5000万+活跃投资企业  20000+产业集群和园区',
          link: window.location.href,
          imgUrl:`https://wan3.parkic.com/company_logo/111.png`,
          success: function () {
            // 设置成功
          }
        })
         //自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容（1.4.0）
        wx.updateTimelineShareData({ 
          title: document.title, // 分享标题
          link: window.location.href,
          imgUrl:`https://wan3.parkic.com/company_logo/111.png`,
          success: function () {
            // 设置成功
          }
        })
      }); 
    },
  }
}
</script>
<style lang="scss" scoped>
  .ddd_d{
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #141D26;
    z-index: 1;
    color: #ccc;
    cursor: pointer;
  }
.index{
  overflow-x: hidden;
  .mask{
    position: fixed;
    left: 0;
    top: 0;
    z-index: -100;
    width: 100%;
    height: 100%;
    background: rgba($color: #000000, $alpha: .5);
    opacity: 0;
    transition: all 0.2s;
  }
  .mask_show{
    z-index: 100;
    opacity: 1;
  }
}
.height5rem{
  height: 5rem;
}
.menu_list1{
  transform: translateY(0) !important;
}
.menu_list{
  padding: 47px 12px 0 12px;
  text-align: left;
  font-size: 14px;
  color: #fff;
  background: #232428;
  transition: all 0.5s;
  transform: translateY(-100%);
  // height: ;
  .menu_item{
    .menu_item1_a{
      color: #396fff !important;
    }
    .menu_item1{
      padding: 14px 0;
      border-top: 1px solid #353535;
      position: relative;
      .jt{
        position: absolute;
        right: 0px;
        top: 18px;
        font-weight: 800;
        transition: all 0.3s;
        transform-origin: center;
      }
      .shang{
        transform: rotate(-180deg);
        top:14px;
      }
    }
    .menu_item2{
      border-top: 1px solid #353535;
      color:#999;
      padding-left: 26px;
      height: 42px;
      line-height: 42px;
      transition: all 0.3s;
      transition-delay: 0.3s;
    }
  }
  .noShow{
    height: 0px !important;
    // display: none;
  }
  .noShow1{
    height: 126px;
    transition: all 0.3s;
    overflow: hidden;
  }
  .noShow2{
    height: 168px;
    transition: all 0.3s;
    overflow: hidden;
  }
}
.header{
    top: 0;
    left: 0;
    width: 100%;
    color: #fff;
    text-align: center;
    z-index: 1000;
    position: fixed;
    height: 48px;
    padding: 0 15px;
    background: linear-gradient(130deg,#0f1312,#151c25,#151e4d);
    box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
    .menu_bnt{
      width: 22px;
      height: 2px;
      background: #fff;
      position: relative;
      transition: all 0.5s;
      transform-origin: center;
      &::before{
        position: absolute;
        content: ' ';
        width: 22px;
        height: 2px;
        background: #fff;
        bottom: -8px;
        left: 0;
      }
      &::after{
        position: absolute;
        content: ' ';
        width: 22px;
        height: 2px;
        background: #fff;
        top: -8px;
        left: 0;
      }
    }
    .menu_bnt_z{
      transform: rotate(-90deg) !important;
    }
    .logo{
      // width: 7.5rem;
      height: 36px;
      top: 0;
      bottom: 0;
      margin: auto 0;
      margin-right:  40px;
      cursor: pointer;
    }
  }
  .footerWrap{
    min-height: 26.8125rem;
    color: #fff;
    background: #21282d;
    padding-top: 3.75rem;
    width:100%;
    // position: absolute;
    // bottom:0;
    // left: 0;
    .bottom_wrap{
      width: 100%;
      margin: 0 auto;
      height: 100%;
      padding-bottom: 2.5rem;
      color: #fff;
    }
    .top-box{
      width: 100%;
      height: auto;
      padding-bottom: 2.5rem;
      border-bottom: .0625rem solid #363636;
      text-align:left;
      display:flex;
    }
    .tabBox1{
      width: 200px;
    }
    .tabBox{
      display: inline-block;
      margin-right: 6rem;
    }
    .tabBoxw{
      width: 300px;
    }
    .tabBoxc{
      // margin-left: 10%;
      margin-right: 0;
    }
    .arcode{
      display: inline-block;
      text-align:center;
      img{
        height: 7.5rem;
        width: 7.5rem;
      }
      p{
        display: block;
        margin-top:10px;
        color: hsla(0,0%,100%,.5);
      }
    }
    .arcode1{
      margin-right: 64px;
    }
    .title{
      font-size: 1.25rem;
      font-family: MicrosoftYaHeiUI;
      color: #fff;
      line-height: 1.25rem;
      display: block;
      margin-bottom: 2.125rem;
      position: relative;
      &::after{
        content: ' ';
        position: absolute;
        bottom: -14px;
        left: 0;
        width: 140px;
        height: 1px;
        background: rgba($color: #fff, $alpha: .5);
      }
    }
    .list{
      display: block;
      font-size: 1rem;
      font-family: MicrosoftYaHeiUI;
      color: hsla(0,0%,100%,.5);
      margin-bottom: 1.5625rem;
      cursor: pointer;
      &:hover{
        color: #fff;
      }
    }
    .ks_clear{
      &::after{
        content: " ";
        display: block;
        height: 0;
        clear: both;
      }
    }
    .bottom-box {
      padding-top: 2rem;
      text-align: left;
      .bottom-title{
        display: inline-block;
        font-size: 1rem;
        font-family: MicrosoftYaHeiUI;
        color: #fff;
        line-height: 1.25rem;
        margin-right: 2rem;
      }
      .link-name{
        display: inline-block;
        font-size: 1rem;
        font-family: MicrosoftYaHeiUI;
        color: hsla(0,0%,100%,.5);
        line-height: 1.25rem;
        margin-right: 2.5rem;
        cursor: pointer;
      }
    }
  }
  .btn11{
        background: transparent;
    color: #ffc555;
    padding: 0px 20px;
    border: 1px solid #ffc555;
    border-radius: 8px;
    font-size: 18px;
    height: 36px;
    line-height: 36px;
    transition: transform .1s linear,opacity .1s linear;
    position: relative;
    &:hover{
      cursor: pointer;
      transform: translateY(-2px);
    }
  }
  .ttt_div{
  height: 142px;
  background: url(~@/assets/img/f_bg.png) no-repeat 50%;
  background-size: cover;
  background-color: #396fff;
  text-align: center;
  color: #fff;
  .b_s{
    font-size: 17px;
    text-align: center;
    padding-top: 20px;
  }
  .s_s{
    padding-left: 6px;
    font-size: 12px;
    line-height: 32px;
    letter-spacing: 4px;
    margin: 0 auto 14px;
  }
}
.bb_b{
  margin-top: 40px;
  width: 200px;
  margin: 0 auto;
  .bb1{
    background: #fff;
    color: #0a1633;
    width: 80px;
    height: 32px;
    line-height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
  }
  .bb2{
    border: 1px solid #fff;
    color: #fff;
    font-size: 13px;
    width: 80px;
    height: 32px;
    line-height: 32px;
    border-radius: 4px;
    cursor: pointer;
  }
}
.forth_box {
  background: url(~@a/img/bottom.png) 0 0 no-repeat;
  background-size: 100% 100%;
  height: 184px;
  padding-top: 45px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  h1{
    font-size: 18px;
    text-align: center;
    color: #fff;
     span{
      font-size: 16px;
      padding-left: 10px;
      font-weight: 400;
    }
  }
 
}
.bottom{
  width: 100%;
  height: 337px;
  background-color: #112f50;
  padding-top: 0.5px;
  padding-bottom: 10px;
  .logo_b{
    display: block;
    width: 250px;
    height: 60px;
    margin: 24px auto 16px;
    background-image: url(~@a/img/logo111.png);
    background-position: center center;
    background-size: 100%;
    background-repeat: no-repeat;
  }
  .code{
    display: block;
    width: 100px;
    height: 100px;
    margin: 0px auto 12px;
    background-image: url(~@a/img/2wm.png);
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
  }
  .text{
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #fff;
    margin: 0 auto 24px;
  }
  .btn{
    width: 311px;
    height: 44px;
    text-align: center;
    line-height: 44px;
    color: #fff;
    font-size: 16px;
    margin: 24px auto 34px;
    background-color: #f69e33;
  }
}
</style>
<style>   
/* .el-popover{
  background: #151c25 !important;
  color: #fff;
  border:none;
} */
.item_xl{
  margin:15px 0;
  font-size: 15px;
}
.item_xl:hover{
  color: #396fff;
  position: relative;
  cursor: pointer;
}
.item_xl::after{
  /* content: ' ';
  background: #396fff;
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%; */
}
.active_item_xl{

}
</style>